Repository navigation
fix(acp-adapter): delete owned serve sessions on shutdown (#8313) - #11218
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 24 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
What
The ACP adapter (
bin/opencode-acp-adapter.mjs) now deletes the serve sessions it created when it shuts down — on stdin close and on SIGTERM — instead of leaving them on the ONE standing sharedopencode serveforever.Step 1 evidence (why this branch of the issue)
Verified against the pinned serve (flake.lock
opencode= fork rev34cb01197a2fa9f6fe75ac9f8e2a2ac3774bba53): there is no server-side idle session expiry. The only inactivity mechanism,packages/core/src/location-activity.ts, interrupts inactive executions and evicts cached location service graphs; session records are durable and are removed solely through the explicitDELETE /api/session/:sessionIDroute (packages/protocol/src/groups/session.ts, operationIdsession.remove). So the adapter-side cleanup branch of the issue applies.Change
DELETE /api/session/:idfor every key of the adapter'ssessionsmap (exactly the sessions this adapter created viaPOST /api/session). Best-effort and bounded: each delete is abort-timed against a 2s overall budget, failures are swallowed, and a hard timer guarantees exit is never blocked on the serve.Tests
node --test bin/opencode-acp-adapter.test.mjs— 24/24 pass, including two new tests: stdin close and SIGTERM each produce exactly oneDELETE /api/session/<created id>at the stub serve before the adapter exits 0. The stub serve gained the DELETE route.Queue task 20119 (lane code-a). No closing keyword for #8313 in this body — the worker closes the issue with evidence after merge.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit